/*
 * @Author: wwssaabb
 * @Date: 2021-07-24 10:41:18
 * @LastEditTime: 2021-07-24 14:02:01
 * @FilePath: \demo\react_demo\react_stagin_demo\src\redux\reducers\Person.js
 */

import { ADD_PERSON } from '../constant'

export default function PersonReducer(preState=[{id:'001',name:'joker',age:23}],action){
  const {type,data}=action
  switch (type) {
    case ADD_PERSON:
      return [data,...preState]
    default:
      return preState
  }
}